﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLBH
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }
        #region khởi tạo
        NhanVien nv = new NhanVien();
        Khachhang kh = new Khachhang();
        SanPham sp = new SanPham();
        HoaDon hd = new HoaDon();
        CTHD ct = new CTHD();
        #endregion
        #region Button quản lý
        private void bQuanLy_Click(object sender, EventArgs e)
        {
            if (pTT.Visible == false)
                pTT.Visible = true;
            else
                pTT.Visible = false;
            //test.Text = ((CKhachhang)KH.list_kh[0]).Makh;
        }
        #endregion
        #region Button Quản lý thông tin nhập
        private void lQlTTnhap_Click(object sender, EventArgs e)
        {
            Display.Controls.Clear();
            TabControl tabQL = new TabControl();
            Display.Controls.Add(tabQL);
            tabQL.Size = new Size(592, 383);
            //nv
            TabPage tp0 = new TabPage();
            tabQL.TabPages.Add(tp0);
            tabQL.TabPages[0].Text = "QL Nhân Viên";
            tabQL.TabPages[0].Controls.Add(nv);
            //kh
            TabPage tp1 = new TabPage();
            tabQL.TabPages.Add(tp1);
            tabQL.TabPages[1].Text = "QL Khách Hàng";
            tabQL.TabPages[1].Controls.Add(kh);
            //sp
            TabPage tp2 = new TabPage();
            tabQL.TabPages.Add(tp2);
            tabQL.TabPages[2].Text = "QL Sản Phẩm";
            tabQL.TabPages[2].Controls.Add(sp);
        }

        private void lQlTTnhap_MouseMove(object sender, MouseEventArgs e)
        {
                lQlTTnhap.Font = new Font(lQlTTnhap.Font, FontStyle.Underline);
        }

        private void lQlTTnhap_MouseLeave(object sender, EventArgs e)
        {
            lQlTTnhap.Font = new Font(lQlTTnhap.Font, FontStyle.Regular);
        }
        #endregion
        #region Button Quản lý hóa đơn
        private void lQlhd_Click(object sender, EventArgs e)
        {
            Display.Controls.Clear();
            TabControl tabQL = new TabControl();
            Display.Controls.Add(tabQL);
            tabQL.Size = new Size(592, 383);
            //HD
            TabPage tp0 = new TabPage();
            tabQL.TabPages.Add(tp0);
            tabQL.TabPages[0].Text = "QL Hóa Đơn";
            tabQL.TabPages[0].Controls.Add(hd);
            //CTHD
            TabPage tp1 = new TabPage();
            tabQL.TabPages.Add(tp1);
            tabQL.TabPages[1].Text = "QL CTHD";
            tabQL.TabPages[1].Controls.Add(ct);
        }

        private void lQlhd_MouseMove(object sender, MouseEventArgs e)
        {
            lQlhd.Font = new Font(lQlhd.Font, FontStyle.Underline);
        }

        private void lQlhd_MouseLeave(object sender, EventArgs e)
        {
            lQlhd.Font = new Font(lQlhd.Font, FontStyle.Regular);
        }
        #endregion
        #region Quản lý đăng nhập
        private void frmMain_Load(object sender, EventArgs e)
        {
            frmLogin log = new frmLogin();
            log.ShowDialog();
            if (log.Flag == false)
            {
                this.Close();
            }
        }
        #endregion
        #region Button Quản lý thông tin tra cứu
        private void bTraCuu_Click(object sender, EventArgs e)
        {
            UTracuu Tc = new UTracuu();
            Display.Controls.Clear();
            Display.Controls.Add(Tc);
        }
        #endregion
        #region Button Quản lý thông tin trợ giúp
        private void button1_Click(object sender, EventArgs e)
        {
            UHelp Help = new UHelp();
            Display.Controls.Clear();
            Display.Controls.Add(Help);
        }
        #endregion
    }
}
